package com.ddwl.common.feign.wx;

import com.ddwl.schema.bo.gate.wechat.WxCustomMsgBo;
import com.ddwl.schema.bo.gate.wechat.WxSubscribeBo;
import com.ddwl.schema.bo.message.WxTemplateBo;
import com.ddwl.schema.bo.message.WxUniformMsgBo;
import com.ddwl.schema.vo.base.WxRestVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author Fu Zhaohui
 * @version 1.0.0
 * @date 2021/6/2 17:26
 */
@Api(tags = "微信消息API")
@FeignClient(name = "WxMsgApi", path = "/cgi-bin/message", url = "https://api.weixin.qq.com")
public interface WxMsgApi {

    @ApiOperation("自定义事件发送消息")
    @PostMapping("/custom/send")
    WxRestVo customSend(@RequestParam("access_token") String access_token, @RequestBody WxCustomMsgBo bo);

    @ApiOperation("订阅消息发送")
    @PostMapping("/subscribe/send")
    WxRestVo subscribeSend(@RequestParam("access_token") String access_token, @RequestBody WxSubscribeBo bo);

    @ApiOperation("模板消息推送")
    @PostMapping("/template/send")
    WxRestVo templateMsg(@RequestParam("access_token") String access_token, @RequestBody WxTemplateBo bo);

    @ApiOperation("统一服务消息")
    @PostMapping("/wxopen/template/uniform_send")
    WxRestVo uniformMsg(@RequestParam("access_token") String access_token, @RequestBody WxUniformMsgBo bo);
}
